<?php

$this->useClass("Handler_Community");
class Action_Community_RssRuleFeedManage extends Handler_Community
{
	private $lib_rss;
	
	public function init() {
		parent::init();
		$this->rh->UseClass("RL_URLGenerator");
				
		$this->rfl = $this->ctx->mm->getModel("RssFeedList");
		$this->rfl->setCommunityOid($this->aa->acl_data['comity_oid']);
		
		$this->rf_rels = $this->ctx->mm->getModel("RuleFeedRelation");
		$this->rules = $this->ctx->mm->getModel("RssRule");
	}
	
	public function process ()
	{
		$aa = $this->aa;
		$acl_data = $aa->getInfo();
		if (!$aa->is_granted('community_edit')) return;
		
		$view = $this->rh->views->findByName('rss_rule_feed');
		$view->data = $aa->template_data;
		$view->data['rfl'] = $this->rfl->getFeedList();
		$view->data['rules'] = $this->rules->getRules($this->aa->acl_data['comity_oid']);
		
		
		$this->rh->response->setContent($view);
	} // end of function process

}

